﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace Diplom.Graphics.D2D
{

    /// <summary>
    /// Не вижу смысла тут использовать статический класс, так думаю вполне сносно
    /// Каких конструкторов не хватит можно по ходу добавлять )
    /// </summary>
    public class DrawStyle
    {
        #region Fields

        Pen drawPen;
        Brush drawBrush;

        #endregion

        #region Properties

        public Pen DrawPen
        {
            get
            {
                return drawPen;
            }
        }

        public Brush DrawBrush
        {
            get
            {
                return drawBrush;
            }
        }

        #endregion

        #region .ctor

        /// <summary>
        /// brush заполняет все проперти pen'a и сам копируется в drawbrush
        /// </summary>
        /// <param name="brush"></param>
        public DrawStyle(Brush brush)
        {
            drawPen = new Pen(brush);
            drawBrush = brush;
        }

        public DrawStyle(Color penColor, float width, DashStyle dash, Color brushColor)
        {
            drawPen = new Pen(penColor,width);
            drawPen.DashStyle = dash;
            drawBrush = new LinearGradientBrush(new Point(0,0), new Point(1,1), brushColor, brushColor);
        }

        /// <summary>
        /// Конструктор в котором стандартный Pen и Brush типа LinearGradientBrush
        /// </summary>
        /// <param name="penColor">Цвет карандаша</param>
        /// <param name="brushP1">Левый верхний угол прямоугольника, для кисти</param>
        /// <param name="brushP2">Правый нижний угол прямоугольника, для кисти</param>
        /// <param name="brushColor1">Первый цвет для заливки</param>
        /// <param name="brushColor2">Второй цвет для заливки</param>
        public DrawStyle(Color penColor,
            Point brushP1, Point brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor);
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        public DrawStyle(Color penColor, float width,
            Point brushP1, Point brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor, width);
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        public DrawStyle(Color penColor,
            PointF brushP1, PointF brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor);
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        public DrawStyle(Color penColor, float width,
            PointF brushP1, PointF brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor);
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        public DrawStyle(Color penColor, DashStyle dashStyle,
            Point brushP1, Point brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor);
            drawPen.DashStyle = dashStyle;
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        public DrawStyle(Color penColor, float width, DashStyle dashStyle,
            Point brushP1, Point brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor, width);
            drawPen.DashStyle = dashStyle;
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        public DrawStyle(Color penColor, DashStyle dashStyle,
            PointF brushP1, PointF brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor);
            drawPen.DashStyle = dashStyle;
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        public DrawStyle(Color penColor, float width, DashStyle dashStyle,
            PointF brushP1, PointF brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor, width);
            drawPen.DashStyle = dashStyle;
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        public DrawStyle(Color penColor, DashStyle dashStyle, LineCap startCap, LineCap endCap,
            Point brushP1, Point brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor);
            drawPen.DashStyle = dashStyle;
            drawPen.StartCap = startCap;
            drawPen.EndCap = endCap;
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        public DrawStyle(Color penColor, float width, DashStyle dashStyle, LineCap startCap, LineCap endCap,
            Point brushP1, Point brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor, width);
            drawPen.DashStyle = dashStyle;
            drawPen.StartCap = startCap;
            drawPen.EndCap = endCap;
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        public DrawStyle(Color penColor, DashStyle dashStyle, LineCap startCap, LineCap endCap, PenAlignment alignment,
            Point brushP1, Point brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor);
            drawPen.DashStyle = dashStyle;
            drawPen.StartCap = startCap;
            drawPen.EndCap = endCap;
            drawPen.Alignment = alignment;
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        public DrawStyle(Color penColor, float width, DashStyle dashStyle, LineCap startCap, LineCap endCap, PenAlignment alignment,
            Point brushP1, Point brushP2, Color brushColor1, Color brushColor2)
        {
            drawPen = new Pen(penColor, width);
            drawPen.DashStyle = dashStyle;
            drawPen.StartCap = startCap;
            drawPen.EndCap = endCap;
            drawPen.Alignment = alignment;
            drawBrush = new LinearGradientBrush(brushP1, brushP2, brushColor1, brushColor2);
        }

        #endregion
    }
}
